<%@ include file="connect.jsp" %>
<%--
  Created by IntelliJ IDEA.
  User: Mery
  Date: 10/25/12
  Time: 11:03 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


<html>
<head>
    <title>Business English</title>
    <link href="style.css" rel="stylesheet"/>
</head>
<body>
<table id="bg" cellspacing="0">
    <tr id="header">

        <td class="link">
            <%@ include file="header.jsp" %>
        </td>
    </tr>
    <tr id="menu">
        <td>
            <%@ include file="menu.jsp" %>
        </td>
    </tr>
    <tr id="hr">
        <td><hr width="100%" size="8" noshade="noshade" ></td>
    </tr>
    <tr id="content">
        <td class="link" valign="top" style="padding-left: 20px">

            <table>
                <tr id="title">
                    <td>Post Test >> Add New Question</td>
                </tr>
            </table>
            <table>
                <form action="AddNewQuePost.jsp" method="post">

                    <tr>
                        <td>Question's Type</td>
                        <td>:</td>
                        <td><select name="tipe"
                                    style="width:155px;  font-family: Segoe UI; sans-serif; font-size: 12pt">

                            <%
                                String Tipe = request.getParameter("tipe");
                                ResultSet rs = stat.executeQuery("select * from styles");
                                while (rs.next()) {

                                    String tipe = rs.getString("stylesName");


                            %>
                            <option value="<%=tipe%>"><%=tipe%>
                            </option>


                            <%}%>
                        </select>
                        </td>


                    </tr>
                    <tr>
                        <td>Category</td>
                        <td>:</td>
                        <td>
                            <select name="category" style="width:155px;  font-family: Segoe UI; font-size: 12pt">
                                <%
                                    rs = stat.executeQuery("select * from categories order by categoryid asc");
                                    while (rs.next()) {

                                        String kategori = rs.getString("categoryName");
                                        String idKategori = rs.getString("categoryID");

                                %>
                                <option value="<%=idKategori%>"><%=kategori%>
                                </option>

                                <%}%>
                            </select>

                        </td>

                    </tr>
                    <input type="hidden" name="idTest" value="2">
                    <input type="hidden" name="namaTest" value="Posttest">
                    <tr align="right">

                        <td colspan="3">
                            <div class="btn-fld">
                                <a href="posttest.jsp">
                                    <button type="button">Cancel</button>
                                </a>
                                <button type="submit">Add</button>
                            </div>
                        </td>

                    </tr>
                </form>


                <table>
                    <tr>
                        <td>
                            <%
                                if (Tipe != null && Tipe.equals("Multiplechoice")) {%>
                            <%@ include file="pilgan.jsp" %>

                            <% } else if (Tipe != null && Tipe.equals("Voice Recognition")) { %>
                            <%@ include file="voice.jsp" %>
                            <% } else if (Tipe != null && Tipe.equals("Writing")) { %>
                            <%@ include file="writing.jsp" %>
                            <% } %>


                        </td>
                    </tr>


                </table>

            </table>
        </td>
    </tr>

</table>
</body>
</html>